
#ifndef EVENT_LIST_QUEUE_H
#define EVENT_LIST_QUEUE_H

#include <list>
#include "base/SimpleEvent.h"
#include "base/Lock.h"

enum EventType
{
	CONNECTION_WORK_NONE,
	CONNECTION_USER_OPENURL,
	CONNECTION_USER_DOSHOT,
	CONNECTION_USER_START_RECORD,
	CONNECTION_USER_STOP_RECORD,
	CONNECTION_USER_OPEN_FAILED,
	CONNECTION_USER_CONNECTION_ERR,
	CONNECTION_USER_CLOSEURL,
	CONNECTION_USER_START_MP3,
	CONNECTION_USER_STOP_MP3,
};


class EventList{
public:
	EventList()
		:type(CONNECTION_WORK_NONE)
	{
	}

	~EventList(){}

	EventType type;
};



class EventListQueue
{
public:
	EventListQueue();
	~EventListQueue();
	bool enQueue(const EventList & event_l);
	bool deQueue(EventList&  event_l, bool block);

	bool DoQueueQuit();

public:
	std::list<EventList> event_list;

	base::Lock mutex;
	
	base::SimpleEvent m_event;
};

#endif